﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Ad_KhachHangUC.ascx.cs" Inherits="GUI.Admin.uc.Ad_KhachHangUC" %>
<%@ Register Assembly="EO.Web" Namespace="EO.Web" TagPrefix="eo" %>
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!--Panel danh sách các khách hàng-->
<style type="text/css">
    .style1
    {
    }
    .style2
    {
        color: Blue;
        font-size: 25px;
        margin-left: 50px;
    }
    
    .style3
    {
        color: Red;
        font-weight: bold;
    }
    
    .style4
    {
        color: #FF0000;
    }
    .style5
    {
        width: 47%;
    }
    
    .style6
    {
        width: 201px;
    }
    .style7
    {
        width: auto;
    }
    
    .style8
    {
        color: #FF0000;
        margin-top: 100px;
        margin-left: 100px;
    }
    .style9
    {
        text-align: left;
        color: Red;
    }
    
    .tb_left
    {
        width: 15%;
    }
    
    .tb_center
    {
        width: 10%;
    }
    
    .tb_right
    {
        width: 75%;
    }
</style>
<script type="text/javascript">
    function changeCheckState() {
        try {
            var frm = document.forms[0];
            var i = 0;
            for (i = 0; i < frm.length; i++) {
                if (frm.elements[i].id.indexOf('CheckBoxItem') != -1) {
                    if (document.getElementById(frm.elements[i].id) != null) {
                        if (frm.elements[i].checked == false) {
                            frm.elements[i].checked = true;
                        } else {
                            frm.elements[i].checked = false;
                        }
                    }
                }
            }
        } catch (err) { }
    }
</script>
<asp:Panel ID="PanelDanhSachKhachHang" runat="server">
    <table style="width: 100%; border: 1px solid #008000;">
        <tr>
            <td class="style1">
                <asp:ImageButton ID="ImageButtonTroLai" runat="server" ImageUrl="~/Admin/images/back_f2.png" 
                        onclick="ImageButtonTroLai_Click" ToolTip="Trở lại" />
                &nbsp; <span class="style2">Danh sách khách hàng </span>
            </td>
            <td class="style5">
                <span class="style4">Tổng số khách hàng: </span>&nbsp;
                <asp:Label ID="LabelTongSoKhachHang" runat="server" Text="" CssClass="style3">
                </asp:Label>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Label ID="LabelThongBao" CssClass="style8" runat="server" Visible="False"></asp:Label>
                <asp:GridView ID="GridViewKhachHang" runat="server" AllowPaging="True" AutoGenerateColumns="False"
                    CellPadding="4" ForeColor="#333333" Width="100%"
                    OnPageIndexChanging="GridViewKhachHang_PageIndexChanging" OnRowDataBound="GridViewKhachHang_RowDataBound"
                    OnRowCommand="GridViewKhachHang_RowCommand">
                    <RowStyle BackColor="#EFF3FB" />
                    <Columns>                        
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButtonKhoa" runat="server" CommandName="Block" ImageUrl="~/Admin/images/khoataikhoan.gif"
                                    OnClientClick="return confirm('Bạn có muốn khóa tài khoản này không?');" ToolTip="Khóa tài khoản khách hàng này"
                                    CommandArgument='<%# Eval("MaKhachHang") %>' />
                            </ItemTemplate>
                            <HeaderStyle Width="10px" />
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="ImageButtonActive" runat="server" CommandName="Active" ImageUrl="~/Admin/images/Active_2.png"
                                    Width="18px" Height="18px" OnClientClick="return confirm('Bạn có muốn kích hoạt tài khoản này không?');"
                                    ToolTip="Kích hoạt tài khoản khách hàng này" CommandArgument='<%# Eval("MaKhachHang") %>' />
                            </ItemTemplate>
                            <HeaderStyle Width="10px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Mã khách hàng">
                            <ItemTemplate>
                                <asp:Label ID="LabelMaKhachHang" runat="server" Text='<%# Eval("MaKhachHang") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tên khách hàng">
                            <ItemTemplate>
                                <asp:Label ID="LabelTenKhachHang" runat="server" Text='<%# Eval("TenKhachHang") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Giới tính">
                            <ItemTemplate>
                                <asp:Label ID="LabelGioiTinh" runat="server" Text='<%# Eval("GioiTinh") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Địa chỉ">
                            <ItemTemplate>
                                <asp:Label ID="LabelDiaChi" runat="server" Text='<%# Eval("DiaChi") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Email">
                            <ItemTemplate>
                                <asp:Label ID="LabelEmail" runat="server" Text='<%# Eval("Email") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="CMND">
                            <ItemTemplate>
                                <asp:Label ID="LabelCMND" runat="server" Text='<%# Eval("CMND") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Điện thoại">
                            <ItemTemplate>
                                <asp:Label ID="LabelDienThoai" runat="server" Text='<%# Eval("DienThoai") %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Tình trạng">
                            <ItemTemplate>
                                <asp:Label ID="LabelTinhTrang" runat="server" Text='<%# LoadTinhTrang(Eval("TinhTrang")) %>'></asp:Label>
                            </ItemTemplate>
                            <HeaderStyle Width="100px" />
                        </asp:TemplateField>
                    </Columns>
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </td>
        </tr>
    </table>
</asp:Panel>
